package org.jivesoftware.smack;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import org.jivesoftware.smackx.ConfigureProviderManager;
import org.jivesoftware.smackx.InitStaticCode;

public class SmackAndroid
{
  private static SmackAndroid sSmackAndroid = null;
  private BroadcastReceiver mConnectivityChangedReceiver;
  private Context mCtx;

  private SmackAndroid(Context paramContext)
  {
    this.mCtx = paramContext;
    InitStaticCode.initStaticCode(paramContext);
    ConfigureProviderManager.configureProviderManager();
    maybeRegisterReceiver();
  }

  public static SmackAndroid init(Context paramContext)
  {
    if (sSmackAndroid == null)
      sSmackAndroid = new SmackAndroid(paramContext);
    else
      sSmackAndroid.maybeRegisterReceiver();
    return sSmackAndroid;
  }

  public void onDestroy()
  {
    if (this.mConnectivityChangedReceiver != null)
    {
      this.mCtx.unregisterReceiver(this.mConnectivityChangedReceiver);
      this.mConnectivityChangedReceiver = null;
    }
  }

  private void maybeRegisterReceiver()
  {
    if (this.mConnectivityChangedReceiver == null)
    {
      this.mConnectivityChangedReceiver = new ConnectivtyChangedReceiver();
      this.mCtx.registerReceiver(this.mConnectivityChangedReceiver, new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE"));
    }
  }

  class ConnectivtyChangedReceiver extends BroadcastReceiver
  {
    ConnectivtyChangedReceiver()
    {
    }

    public void onReceive(Context paramContext, Intent paramIntent)
    {
    }
  }
}

/* Location:           D:\hygieia\userclient\common\libs\easemobchat_2.1.8.jar
 * Qualified Name:     org.jivesoftware.smack.SmackAndroid
 * JD-Core Version:    0.6.1
 */